package org.zoomdev.zoom.ioc.impl;

import org.zoomdev.zoom.ioc.MethodParameterNamesGetter;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

public final class JavaMethodParameterNamesGetter implements MethodParameterNamesGetter {
    @Override
    public String[] getParameterNames(Class<?> clazz, Method method) {
        Parameter[] parameters = method.getParameters();
        String[] ret = new String[parameters.length];
        for (int i = 0, c = parameters.length; i < c; ++i) {
            ret[i] = parameters[i].getName();
        }
        return ret;
    }
}
